<template>
<div>
  <div class="talk">
      <Top1/>
      <div v-if="ping">
      <div class="togo" @click="text()">
          返回文章
      </div>
      <ul>
          <li v-for="(v,i) in list" :key="i">
              <div class="top">
                  <img :src="v.img" alt="">
                  <div class="right">
                      <p class="user">{{v.name}} <span>{{v.leve}}</span></p>
                      <span class="dian">{{list[i].state?v.num:v.num+1}} <i @click="dian(i)" :class="list[i].state?'':'zan'" :style="img"></i></span>
                      <p class="data">{{v.data}}</p>
                  </div>
              </div>
              <p class="tack1">{{v.text}}</p>
              <div class="ju">
                  <div class="ab">
                      <img src="newList/ju.png" alt="">
                      <span>举报</span>
                  </div>
              </div>

          </li>
      </ul>
      <div class="bot">
          <div class="self" @click="p()">
              点评一下吧
          </div>
      </div>
      </div>
      <div class="fabiao" v-else>
          <textarea type="text" placeholder="发表评论" v-model="me"></textarea>
          <div class="bott">
              <p @click="quxiao()">取消</p>
              <p @click="submit()">提交</p>
          </div>
          <p class="tishi">温馨提醒：<br>
                任何广告都会被删除，结伴为个人行为请仔细甄别信息，更多说明请见
                <a href="https://m.mafengwo.cn/gl/article/index?id=885">《马蜂窝社区评论规范》</a>
            </p>
      </div>
  </div>
</div>
</template>

<script>
import Top1 from "@/components/Top1.vue"
export default {
    components:{
        Top1,
    },
    data(){
        return {
            list:[
                {img:"newList/t-1.jpg",data:"2020-09-27 20:58:27",name:"Flora走世界",leve:"Lv34",text:"点止甘少，宝华路点点心思又有打折，又全天饮茶，西关的莫大毛，老字号，看店的装修就知道，合广州人味道，价格又亲民。以上两间，去得晚都要排队。炳胜吃鱼生最出名。不在乎钱的话，可去白天鹅饮茶。",num:1,state:true},
                {img:"newList/t-2.jpg",data:"2019-010-27 20:58:27",name:"爱晴柔",leve:"Lv1",text:"这建议犀利",num:1,state:true},
                {img:"newList/t-3.jpg",data:"2019-05-27 20:58:27",name:"心不在焉",leve:"Lv11",text:"惠价实",num:1,state:true},
                {img:"newList/t-4.jpg",data:"2018-09-27 20:58:27",name:"食之秘",leve:"Lv25",text:"好吃的美食就是要分享嘛。可以分享在蜂食记这个专门分享美食的小程序上面哦！",num:1,state:true},
                {img:"newList/t-5.jpg",data:"2017-09-27 20:58:27",name:"Parkney",leve:"Lv45",text:"这是什么年代的攻略",num:1,state:true},
            ],
           img:{backgroundImage: "url(" + require("sta/ibg.png") + ")"},
           ping:true,
           me:""
        }
    },
    methods:{
        dian(i){
            this.list[i].state = !this.list[i].state;
        },
        text(){
            this.$router.go(-1);
        },
        p(){
            this.ping = false;
        },
        quxiao(){
            this.ping = true;
        },
        submit(){
            this.list.unshift({img:"img/tou.png",data:"刚刚",name:"马蜂窝用户",leve:"Lv1",text:this.me,num:0,state:true});
            this.ping = true;
        }
    },
    
}
</script>

<style scoped>
    .togo{
        line-height: 1.2rem;
        font-size: .38rem;
        color: #248bf3;
        width: 100%;
        height: 1.2rem;
        text-align: center;
        border-top: 1px dashed#ece8e8;
    }
    ul{
        padding: 0 0.4rem;
        margin-top: 0.35rem;
    }
    ul li{
        margin-bottom: 1.2rem;
        border-bottom: 1px dashed#ece8e8;
    }
    ul li .top{
        display: flex;
        position: relative;
    }
    ul li .top .dian{
        position: absolute;
        top: 0.25rem;
        right: 0.2rem;
        color: #666;
        font-size: 0.3rem;
    }
    ul li .top .zan{
        background-position: -2.9333333333rem 0;
    }
    ul li .top i{
        margin-left: 0.15rem;
        display: inline-block;
        width: .4266666667rem;
        height: .4266666667rem;
        background: url(/newList/ibg.png) -2.9333333333rem -0.5333333333rem no-repeat;
        background-size: 5.3333333333rem;
    }
    ul li .top img{
        width: 1.15rem;
        height: 1.15rem;
        border-radius: .64rem;
    }
    .top .right{
        margin-left: 0.35rem;
        margin-top: 0.15rem;
    }
    .top .user{
        font-size: .45rem;
        position: relative;
    }
    .top .user span{
        background-color: #474747;
        color: #ffdb26;
        border: 1px solid #474747;
        line-height: .2rem;
        height: .2rem;
        font-size: 0.25rem;
        padding: 0.05rem;
        border-radius: 0.08rem;
    }
    .top .data{
        font-size: 0.3rem;
        color: #666;
        line-height: 0.5rem;
    }
    .tack1{
        font-size: .38rem;
        line-height: 1.4em;
        padding: .2666666667rem 0;
        color: #6b6868;
    }
    .ju{
        width: 100%;
        height: 0.8rem;
        position: relative;
        line-height: 1rem;
    }
    .ju .ab{
        position: absolute;
        top: 0;
        right: 0;
        color: #6b6868;
        font-size: 0.25rem;
    }
    .ju .ab img{
        width: 0.38rem;
    }
    .ju .ab span{
        position: relative;
        margin-left: 0.1rem;
        top: 0.05rem;
    }
    .bot{
        width: 100%;
        position: fixed;
        bottom: 0;
        height: 1.25rem;
    }
    .bot .self{
        width: 90%;
        margin: 0.25rem auto;
        height: 0.8rem;
        line-height: 0.8rem;
        background-color: #f4f4f4;
        color: #666;
        font-size: 0.35rem;
        padding-left: 0.25rem;
        border-radius: 0.25rem;
    }
    .fabiao{
        margin-top: 0.25rem;
    }
    .fabiao textarea{
        display: block;
        width: 88%;
        margin: auto;
        min-height: 2.6rem;
        overflow-y: auto;
        overflow-x: hidden;
        white-space: pre-wrap;
        background-color: #f4f4f4;
        font-size: 0.4rem;
        color: #767676;
        padding: 0.25rem;
        border: none;
        line-height: 1.2em;
        border-radius: 0.25rem;
    }
    .fabiao .bott{
        width: 88%;
        margin: auto;
        margin-top: 0.5rem;
        display: flex;
        justify-content: space-between;
    }
    .fabiao .bott p{
        width: 45%;
        height: 0.8rem;
        line-height: 0.8rem;
        text-align: center;
        font-size: 0.35rem;
        background-color: #fff;
        color: #767676;
        border-radius: 0.2rem;
    }
    .fabiao .bott p:first-child{
        border: 1px solid  #dfdddd;
    }
    .fabiao .bott p:last-child{
        background-color: #ffdb26;
    }
    .tishi{
        width: 88%;
        margin: auto;
        margin-top: 0.2rem;
        padding: 0.25rem;
        font-size: 0.35rem;
        color: #666;
        line-height: 0.55rem;
    }
    .tishi a{
        color: #248bf3;
    }
</style>